import Stack from "./stack";
import Dec2bin from "./dec2bin";

let stack = new Stack();

// 封装的栈结构测试
alert("javaScript 封装的栈结构测试");

// 1.压栈
alert("压栈测试");

stack.push("1");
alert(stack.toString());

stack.push("2");
alert(stack.toString());

stack.push("3");
alert(stack.toString());

stack.push("4");
alert(stack.toString());

// 2.出栈及栈中元素个数测试
alert("2.出栈及栈中元素个数测试");

stack.pop();
alert(stack.toString());

stack.pop();
alert(stack.toString());

alert("栈顶元素：" + stack.peek());

alert("栈中元素个数：" + stack.size());

alert("栈中元素是否为空：" + stack.isEmpty());

stack.pop();
alert(stack.toString());
stack.pop();
alert(stack.toString());

alert("栈中元素是否为空：" + stack.isEmpty());

//dec2bin 测试
alert("dec2bin 测试");
alert(Dec2bin(10));
alert(Dec2bin(234));
alert(Dec2bin(1000));

alert("测试结束");



